package atguigu.shuzixiangguan;
 
import java.util.regex.Pattern;
 
public class Test {
	 /**
     * 判断一个字符串是否是数字。
     * 
     * @param string
     * @return
     */
    public static boolean isNumber(String string) {
        if (string == null)
            return false;
        Pattern pattern = Pattern.compile("^-?\\d+(\\.\\d+)?$");
        return pattern.matcher(string).matches();
    }
 
    private static void isNumberTest() {
        System.out.println(isNumber("2.30V"));
        System.out.println(isNumber("5234254125424584"));
        System.out.println(isNumber("dfg15s4df5sd1fds"));
    }
 
    public static void main(String[] args) {
//        isNumberTest();
        
        int abs = Math.abs(-1);
        System.out.println(abs);
    }
 
}